package org.example.config;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;

import java.io.IOException;

/**
 * @Author：zj@uinpay.cn
 * @Date: 2024/8/25
 * @Desc:
 */
public class MyAuthenticationSuccHandler implements AuthenticationSuccessHandler {
    @Override
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {

        authentication.getPrincipal(); //获取用户身份信息
        authentication.getAuthorities();//获取用户权限信息
        authentication.getCredentials();//获取用户凭证信息

    }
}
